In the process of digital compressed encoding of audio signals or video signals, a vector composed of a number of sample values of an input signal may be quantized according to a predetermined vector codebook to ensure encoding quality at a lower encoding rate.
Vector quantization is an efficient data compression technology. The input signal is put into one or more groups each of which has K (K=1, 2, 3 and so on) continuous sample values. The group of sample values can make up a vector in a K-dimension Euclidean Space, and each of such vectors can be quantized. The complexity of vector quantization results from two aspects: calculation load and storage load. The complexity of vector quantization increases exponentially with the increase of the vector dimension. Moreover, as a lossy data compression technology, vector quantization involves the problem of encoding rates in addition to the quantization distortion, and the vector dimension is in inverse proportion to the encoding rate. In an environment with grim network conditions, encoding rates are generally reduced in order to avoid packet loss in the network transmission and ensure encoding quality of a certain level, which increases the complexity of vector quantization.
Taking the process of code compression for voice signals in the related art as an example, the vector quantization technology applied to the voice encoding process in the prior art is described below.
In the quantization of a vector composed of Intermittence Spectral Frequency (ISF) coefficients in the related art, the Wideband Adaptive Multi Rate (AMR-WB+) voice codec is generally used to quantize ISF vectors. The ISF coefficient can be converted from a Linear Prediction Coefficient (LPC) of voice signals. The AMR-WB+ quantizes the SIF vectors through joint Split Vector Quantization (SVQ) and Multi Stage Vector Quantization (MSVQ). The process of vector quantization includes: a 1-order Moving Average (MA) prediction method is applied first to work out the current ISF prediction residual vector of frame n (n=1, 2, 3 and so on)-r(n), and then r(n) is quantized through multi-stage codebooks. Table 1 shows bit allocation and codebook utilization in a vector quantization process in the prior art.
TABLE 1Grade of splittingGrade 1Grade 1Vector dimension9733334Quantity of allocated bits8867755Quantity of codebooks256256641281283232
As shown in Table 1, the ISF vector quantization process performed by AMR-WB+ is as follows:
suppose the ISF vector is a 16-dimension vector, r(n) is also a 16-dimension vector. Let r[r1, r2, . . . , r16] in order to reduce the codebook storage load in the vector quantization, the AMR-WB+ performs Split Multi Stage Vector Quantization (S-MSVQ) for vector r:
first, the 16-dimension vector r is split on the first grade to obtain two sub-vectors, namely, 9-dimension vector r1(1) and 7-dimension vector r2(1); r1(1) and r2(1) are quantized through the 8 bits respectively, and the quantity of codebooks for quantizing both r1(1) and r2(1) is 256;
afterward, r1(1) and r2(1) are split on the second grade respectively to obtain 5 sub-vectors;
the 9-dimension r1(1) is split into 3 sub-vectors, namely, 3-dimension r11(2), quantized through 6 bits, the corresponding quantity of codebook vectors is 64; the 3-dimension r12(2) is quantized through 7 bits, and the quantity of codebooks for quantizing both r11(2) and r12(2) is 128, the 3-dimension r13(2) is quantized through 7 bits, and the quantity of codebooks or quantizing r13(2) is 128;
the 7-dimension r2(1) is split into 2 sub-vectors, namely, 3-dimension r21(2), quantized through 5 bits, and the quantity of codebooks for quantizing r21(2) is 32, the 3-dimension r22(2) is quantized through 5 bits, and the quantity of codebooks for quantizing r22(2) is 32.
The foregoing splitting process gives rise to 7 sub-vectors in total, and involves a total of 46 bits allocated for vector quantization.
The two sub-vectors obtained through the grade-1 splitting mentioned above are quantized on the first grade, and the 5 sub-vectors obtained through the grade-2 splitting are quantized on the second grade. The grade-1 quantization process is similar to the grade-2 quantization process. Let rx refer to the component on dimension x (x=1, 2, 3 and so on) of a sub-vector in the 7 sub-vectors, and {circumflex over (r)}xy is the component on dimension x of code word y (y=1, 2, 3 and so on) in the codebook vector corresponding to the sub-vector, the error between rx and {circumflex over (r)}xy can be calculated by formula (1), and the square sum of Δx can be calculated by formula (2).
                              Δ          x                =                              r            x                    -                                    r              ^                        x            y                                              (        1        )                                E        =                              ∑                          x              =              m                        n                    ⁢                                          ⁢                                    [                              Δ                x                            ]                        2                                              (        2        )            
Use E as the distortion of the vector quantization, select y corresponding to the code word that minimizes E among the codebook vectors corresponding to the sub-vector, use y as an index code of the code word, and send it to the decoder. Accordingly, the decoder finds the corresponding code word according to the decoded index, and decodes the relevant information.
The AMR-WB+ vector quantization technology in the related art adopts multi-grade codebook vector quantization, which accomplishes high encoding quality but increases the complexity of vector quantization. The complexity of vector quantization is attributable to storage load and calculation load. In the related art, the codebook storage load is high, which leads to increase of calculation load. In the calculation process, all codebook vectors have to be traversed. Therefore, the related art requires further improvement with respect to reducing complexity of vector quantization.